<script setup>
    // 工程化+组合api+setup语法糖
    import {ref} from 'vue'
   
    //属性和方法 -> vue对象
    let counter = ref(0);
    let add = ()=>{
        counter.value ++;
    }
    let sub = ()=>{
        counter.value --;
    }

    let name ="二狗子";
    let age = 18;

</script>

<template>
  <div>
    <button @click="sub()">-</button>{{ counter }}<button @click="add()">+</button>
    姓名:{{ name }} 年龄: {{ age }}
  </div>
</template>

<style scoped>

</style>